package com.csx.base.design.behavior.mediator;

/**
 * @author cuisongxu
 * @date 2022/10/10 12:04
 */
public class Client {

    public static void main(String[] args) {
        ChatRoom chatRoom = new PrivateChatRoom("设计模式");
        User user3 = new User("张三");
        User user4 = new User("李四");
        User user5 = new User("王五");

        user3.login(chatRoom);
        user4.login(chatRoom);

        user3.talk(user4, "你好，李四兄弟，只有你一个人在?");
        user4.talk(user3, "是啊，三哥");

        user5.login(chatRoom);
        user3.talk(user5, "王老五来了");

    }
}
